<template>
	<view class="whole">
		<view class="pay">
			<view class="header">
				<div>
					<view class="success">
						<up-icon name="checkmark-circle-fill" size="150rpx" color="#00aa00"></up-icon>
						支付成功
					</view>
					<view class="pay">支付金额</view>
					<view class="payNum">
						<span style="font-size: 34rpx">￥</span>
						{{instance.options.pay}}
					</view>
				</div>
			</view>
			<!-- 			<view class="listPay">
				<up-icon name="weixin-circle-fill" size="60rpx" color="#00aa00"></up-icon>
				<view class="text">
					<view class="wx">微信支付</view>
					<view class="subWx">推荐使用微信支付</view>
				</view>
				<view class="btn">
					<label class="radio">
						<radio value="1" :checked="boolWx" color="#FFCC33" style="transform: scale(0.7)" @click="changePayType(1)" />
					</label>
				</view>
			</view>
			<view class="listPay">
				<up-icon name="zhifubao-circle-fill" size="60rpx" color="#00aaff"></up-icon>
				<view class="text">
					<view class="wx">支付宝</view>
				</view>
				<view class="btn">
					<label class="radio">
						<radio value="2" :checked="boolWb" color="#FFCC33" style="transform: scale(0.7)" @click="changePayType(3)" />
					</label>
				</view>
			</view> -->
			<view class="bootom">
				<button type="warn" style="color: #fff" @click="returnHome">返回首页</button>
			</view>
		</view>
	</view>
</template>

<script setup>
import { getCurrentInstance} from  'vue'

 const instance = getCurrentInstance().proxy
 console.log(instance.options.pay);


const returnHome=()=>{
	uni.switchTab({
		url: '/pages/home/home'
	});
}

// 可能会出现泄漏，所以现不做，要路由加密
// export default {
// 	data() {
// 		return {
// 			boolWx: true,
// 			boolWb: false,
// 			payType: 1, //支付类型
// 			price: 0, //支付金额
// 			orderNo: '', //订单号
// 			parentOrderNo: '', //父订单号
// 			submiting: false //控制再次确认支付的弹出框
// 		};
// 	},
// 	onLoad(options) {
// 		this.price = options.price;
// 		if (options.orderno) {
// 			this.orderNo = options.orderno;
// 		} else {
// 			this.parentOrderNo = options.parentorderno;
// 		}
// 	},
// 	methods: {
// 		// 选择支付方式
// 		changePayType(type) {
// 			if (1 == type) {
// 				this.boolWx = true;
// 				this.boolWb = false;
// 			} else {
// 				this.boolWx = false;
// 				this.boolWb = true;
// 			}
// 			this.payType = type;
// 			console.log(this.payType, 'this.payType');
// 		},
// 		// 确认支付
// 		confirm() {
// 			const that = this;
// 			// 线下支付
// 			if (3 === that.payType) {
// 				that.submiting = true;
// 				//请求线下支付的接口
// 			} else if (1 === that.payType) {
// 				//微信支付
// 				that.submiting = true;
// 				//请求微信支付的接口
// 			}
// 		}
// 	}
// };
</script>

<style lang="less" scoped>
.whole {
	background-color: #fff;
	display: flex;
	justify-content: center;

	.header {
		display: flex;
		justify-content: center;
		align-items: center;
		text-align: center;
		flex-wrap: wrap;
		height: 300rpx;

		.pay {
			margin-top: 15rpx;
			width: 100%;
			color: #717171;
		}

		.payNum {
			width: 100%;
			font-size: 44rpx;
			margin: 10rpx 0px 20rpx;
		}
	}

	.pay {
		width: 100%;

		.listPay {
			height: 130rpx;
			display: flex;
			align-items: center;

			.uni-icons {
				margin-left: 20rpx;
			}

			.text {
				width: 40%;
				margin: 0px 20rpx 0px;
			}

			.btn {
				width: 40%;
				text-align: right;
			}
		}

		.bootom {
			width: 90%;
			margin: auto;
			margin-top: 20rpx;
		}
	}
}
.success{
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}
</style>
